﻿namespace AgileBoard.Infrastructure.Data.Repositories
{
    using System;
    using System.Collections.Generic;
    using Domain;
    using Domain.DataInterfaces;
    using SharpArch.Data.NHibernate;

    public class IterationRepository : Repository<Iteration>, IIterationRepository
    {
        #region IIterationRepository Members

        public IList<Iteration> FindByRelease(Guid releaseId)
        {
            return Session.CreateQuery("from Iteration where ReleaseID = :releaseId order by PeriodFrom")
                .SetParameter("releaseId", releaseId)
                .List<Iteration>();
        }

        #endregion

    }
}